// 配置对象
export const followMixin = {
    data() {
        return {
            loading: false
        }
    },
    methods: {
        followFn() {
            this.loading = true
            // 模拟请求
            setTimeout(() => {
                // 省略请求代码
                this.loading = false
            }, 1000)
        }
    }
}

import { ref } from 'vue'
export const usefollow = () => {
    const loading = ref(false)
    const followFn = () => {
        loading.value = true
        setTimeout(() => {
            loading.value = false
        }, 1000)
    }
    return { loading, followFn }
}